import 'package:flutter/material.dart';

import 'easy_elevated_button.dart';
import 'easy_icon_button.dart';
import 'easy_outlined_button.dart';

class EasyButtonDemo extends StatelessWidget {
  const EasyButtonDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // return MaterialApp(
    //   debugShowCheckedModeBanner: false,
    //   title: 'Easy Actions Demo',
    //   theme: ThemeData(
    //     primarySwatch: Colors.orange,
    //     tabBarTheme: const TabBarTheme(dividerColor: Colors.transparent),
    //   ),
    //   home: const BtnPage(),
    // );

    return const BtnPage();
  }
}

class BtnPage extends StatelessWidget {
  const BtnPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'Easy Actions',
        ),
      ),
      body: Padding(
        padding: const EdgeInsets.fromLTRB(20, 12, 20, 0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            const Text(
              'Elevated Buttons',
              style: TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(
              height: 8,
            ),
            Wrap(
              spacing: 12,
              runSpacing: 12,
              children: [
                EasyElevatedButton(
                  label: '简单',
                  //color: Colors.blue,
                  onPressed: () {},
                ),
                EasyElevatedButton(
                  label: '圆形',
                  isRounded: true,
                  onPressed: () {},
                ),
                EasyElevatedButton(
                  label: '阴影',
                  isRounded: true,
                  elevation: 12,
                  onPressed: () {},
                ),
                EasyElevatedButton(
                  label: '左边 Icon',
                  isRounded: true,
                  icon: const Icon(
                    Icons.add,
                    size: 20,
                  ),
                  onPressed: () {},
                ),
                EasyElevatedButton(
                  label: '右边 Icon',
                  isRounded: true,
                  icon: const Icon(
                    Icons.add,
                    size: 20,
                  ),
                  isTrailingIcon: true,
                  onPressed: () {},
                ),
                EasyElevatedButton(
                  label: 'Custom Color',
                  isRounded: true,
                  icon: const Icon(
                    Icons.add,
                    size: 20,
                  ),
                  isTrailingIcon: true,
                  color: Colors.red,
                  onPressed: () {},
                ),
              ],
            ),
            const SizedBox(
              height: 24,
            ),
            const Text(
              'Outlined Buttons',
              style: TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(
              height: 8,
            ),
            Wrap(
              spacing: 12,
              runSpacing: 12,
              children: [
                EasyOutlinedButton(
                  label: 'Simple',
                  onPressed: () {},
                ),
                EasyOutlinedButton(
                  label: 'Rounded',
                  isRounded: true,
                  onPressed: () {},
                ),
                EasyOutlinedButton(
                  label: 'Leading Icon',
                  isRounded: true,
                  icon: const Icon(
                    Icons.add,
                    size: 20,
                  ),
                  onPressed: () {},
                ),
                EasyOutlinedButton(
                  label: 'Trailing Icon',
                  isRounded: true,
                  icon: const Icon(
                    Icons.add,
                    size: 20,
                  ),
                  isTrailingIcon: true,
                  onPressed: () {},
                ),
                EasyOutlinedButton(
                  label: 'Custom Color',
                  isRounded: true,
                  icon: const Icon(
                    Icons.add,
                    size: 20,
                    color: Colors.red,
                  ),
                  isTrailingIcon: true,
                  color: Colors.red,
                  labelColor: Colors.red,
                  onPressed: () {},
                ),
              ],
            ),
            const SizedBox(
              height: 24,
            ),
            const Text(
              'Icon Buttons',
              style: TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(
              height: 8,
            ),
            Wrap(
              spacing: 12,
              runSpacing: 12,
              children: [
                EasyIconButton(
                  icon: Icons.add,
                  onPressed: () {},
                ),
                EasyIconButton(
                  icon: Icons.add,
                  isRounded: true,
                  onPressed: () {},
                ),
                EasyIconButton(
                  icon: Icons.add,
                  elevation: 0,
                  borderRadius: 2,
                  onPressed: () {},
                ),
                EasyIconButton(
                  icon: Icons.add,
                  isRounded: true,
                  elevation: 12,
                  onPressed: () {},
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
